PROJ = remote_download
VER = debug

include ../Makedefs

SRCS = main.c telnet_thread.c
OBJS = $(SRCS:.c=.o)
LIBS = $(LIBDIR)/nutinit.o $(MODS) -lnutpro -lnutos \
	   -lnutarch -lnutdev -lnutnet -lnutfs -lnutcrt
TARG = $(PROJ).hex

ifeq ($(VER), debug)
DEFS += -DDEBUG=1
endif

all: $(OBJS) $(TARG) $(ITARG) $(DTARG)

include ../Makerules

clean:
	-rm -f $(OBJS)
	-rm -f $(TARG) $(ITARG) $(DTARG)
	-rm -f $(PROJ).eep
	-rm -f $(PROJ).obj
	-rm -f $(PROJ).map
	-rm -f $(SRCS:.c=.lst)
	-rm -f $(SRCS:.c=.bak)
	-rm -f $(SRCS:.c=.i)

flash:
	-"C:/Program Files/SEGGER/JLinkARM_V374f/JFlashARM.exe" -openprj"C:\Program Files\SEGGER\JLinkARM_V374f\Samples\JFlash\ProjectFiles\AT91SAM7X256.jflash" -open$(ITARG),0x100000 -auto -disconnect -exit
